package com.lyl.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lyl.domain.WorkIssue;
import com.lyl.model.Result;
import com.lyl.service.WorkIssueService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @author lylbell
 * @date 2021-06-30 15:38
 */
@RestController
@Api(tags = "客户工单管理")
public class WorkIssueController {


    @Autowired
    private WorkIssueService workIssueService;

    @GetMapping("/workIssues")
    @ApiOperation(value = "分页查找客服工单")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "current",value = "当前页"),
            @ApiImplicitParam(name = "size",value = "每页数量"),
            @ApiImplicitParam(name = "status",value = "状态"),
            @ApiImplicitParam(name = "startTime",value = "客服工单的创建开始时间"),
            @ApiImplicitParam(name = "endTime",value = "客服工单的创建结束时间时间"),
    })
    public Result<Page<WorkIssue>> getByPage(@ApiIgnore Page<WorkIssue> page,Integer status,String startTime,String endTime) {
        Page<WorkIssue> pages = workIssueService.getByPage(page,status,startTime,endTime);
        return Result.ok(pages);
    }
}
